#include <stdio.h>
int main()
{
	char s[51] = {0};
	scanf("%s",s);
	char *p = s;
	while(*p)
{
	
	if((*p >= 'a'&&*p <= 'z')||(*p >= 'A'&& *p <= 'Z'))//
	{
		printf("%c",*p);
	}
	if(*p >= '0'&&*p <= '9')//
	{
		int flag = 0;
		int num = 0;
		while(*p >= '0'&&*p <= '9')
		{
		   num = 10*num +(*p-'0');//
		   p++;
		   flag++;
		}
		for(int i = 0;i<num-1;i++)
		{
			printf("%c",*(p-flag-1));//
			
		}
		continue;
	}
		
	p++;
}
    return 0;
	
}